import request from '@/utils/request'

export async function getUserList(data) {
  let res = await request({
    method:"get",
    url:"/system/luntaiUser/list",
    params:data
  })

  return res
}

export async function carListUserId(data) {
  let res = await request({
    method:"post",
    url:"/system/car/list2",
    data:data
  })

  return res.data
}

export async function getCarList(data) {
  let res = await request({
    method:"get",
    url:"/system/car/list",
    params:data
  })

  return res
}

export async function userTyreList(data) {
  let res = await request({
    method:"get",
    url:"/system/userTyre/list3",
    params:data
  })

  return res
}
export async function updateTyre(data) {
  let res = await request({
    method:"put",
    url:"/system/userTyre/edit",
    data:data
  })

  return res
}

export async function deleteTyre(data) {
  let res = await request({
    method:"delete",
    url:"/system/userTyre/"+data,
  })

  return res
}

export async function insertTyre(data) {
  let res = await request({
    method:"post",
    url:"/system/userTyre/add",
    data:data
  })

  return res
}


export async function updateUserInfo(data) {
  let res = await request({
    method:"put",
    url:"/system/luntaiUser/edit",
    data:data
  })

  return res.data
}

export async function addCar(data) {
  let res = await request({
    method:"post",
    url:"/system/car/add",
    data:data
  })

  return res.data
}
// 查询所有品牌
export async function getTyreList(data) {
  let res = await request({
    method:"get",
    url:"/system/tyre/list2",
    data:data
  })

  return res.data
}
// 查询所店铺
export async function getStoreList(data) {
  let res = await request({
    method:"get",
    url:"/system/store/list2",
    data:data
  })

  return res.data
}


export async function uploadImage(file) {
  let formData = new FormData();
  formData.append('file', file);
  let res = await request({
    url: '/system/upload/uploadPic',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data',
    }
  })
  return res

}

export  async function updateUserCar(data) {
  let res = await request({
    method:"put",
    url:"/system/car/edit",
    data:data
  })

  return res.data
}
//获取商铺列表
export  async function getStoreArray(data) {
  let res = await request({
    method:"get",
    url:"/system/store/list",
    params:data
  })

  return res
}

//提交申请列表
export  async function insertShop(data) {
  let res = await request({
    method:"post",
    url:"/system/store/add",
    data:data
  })

  return res
}
//提交修改列表
export  async function updateShopStore(data) {
  let res = await request({
    method:"post",
    url:"/system/store/edit",
    data:data
  })

  return res
}
//删除店铺
export  async function deleteStore(data) {
  let res = await request({
    method:"delete",
    url:"/system/store/"+data,
  })

  return res
}
//获取品牌
export  async function obtainBrand(data) {
  let res = await request({
    method:"get",
    url:"/system/tyre/list",
    params:data
  })

  return res
}
//新增品牌
export  async function addNewBrand(data) {
  let res = await request({
    method:"post",
    url:"/system/tyre/add",
    data:data
  })

  return res
}
//修改品牌
export  async function changeBrand(data) {
  let res = await request({
    method:"put",
    url:"/system/tyre/edit",
    data:data
  })

  return res
}
//删除品牌
export  async function deleteBrand(data) {
  let res = await request({
    method:"delete",
    url:"/system/tyre/"+data,
  })

  return res
}
export  async function getMessageList(data) {
  let res = await request({
    method:"get",
    url:"/system/message/list",
    params:data
  })

  return res
}
//删除消息
export  async function deleteMessage(data) {
  let res = await request({
    method:"delete",
    url:"/system/message/"+data,
  })

  return res
}
export  async function getDict(data) {
  let res = await request({
    method:"get",
    url:"/system/dict/data/type/"+data,
  })

  return res.data
}
export  async function insertMessage(data) {
  let res = await request({
    method:"post",
    url:"/system/message/add",
    data
  })

  return res.data
}
export  async function updateMessage(data) {
  let res = await request({
    method:"put",
    url:"/system/message",
    data
  })

  return res.data
}
export  async function getNewsList(data) {
  let res = await request({
    method:"get",
    url:"/system/news/list",
    params:data
  })

  return res
}
export  async function deleteNews(data) {
  let res = await request({
    method:"delete",
    url:"/system/news/"+data,
  })

  return res
}

export  async function insertNews(data) {
  let res = await request({
    method:"post",
    url:"/system/news",
    data
  })

  return res.data
}
export  async function updateNews(data) {
  let res = await request({
    method:"put",
    url:"/system/news/edit",
    data
  })

  return res.data
}

export  async function getInfoList(data) {
  let res = await request({
    method:"get",
    url:"/system/introduce/list",
    params:data
  })

  return res
}
export  async function deleteInfo(data) {
  let res = await request({
    method:"delete",
    url:"/system/introduce/"+data,
  })

  return res
}

export  async function insertInfo(data) {
  let res = await request({
    method:"post",
    url:"/system/introduce/add",
    data
  })

  return res.data
}
export  async function updateInfo(data) {
  let res = await request({
    method:"put",
    url:"/system/introduce/edit",
    data
  })

  return res.data
}

export  async function getRequestList(data) {
  let res = await request({
    method:"get",
    url:"/system/request/list",
    params:data
  })

  return res
}
export  async function getQuestResultList(data) {
  let res = await request({
    method:"get",
    url:"/system/requestResult/list",
    params:data
  })

  return res
}
// 耗材列表
export  async function getEquipment(data) {
  let res = await request({
    method:"get",
    url:"/system/equipment/list",
    params:data
  })

  return res
}
export  async function deleteEquipment(data) {
  let res = await request({
    method:"delete",
    url:"/system/equipment/"+data,
  })

  return res
}

export  async function insertEquipment(data) {
  let res = await request({
    method:"post",
    url:"/system/equipment/add",
    data
  })

  return res.data
}
export  async function updateEquipment(data) {
  let res = await request({
    method:"put",
    url:"/system/equipment/edit",
    data
  })

  return res.data
}
export  async function equipmentUseLog(params) {
  let res = await request({
    method:"get",
    url:"/system/equipmentUseLog/list2",
    params
  })

  return res
}
export  async function getRequestArray(data) {
  let res = await request({
    method:"post",
    url:"/system/request/list2",
    params:data
  })

  return res
}
  export  async function updateRequestStatus(data) {
  let res = await request({
    method:"put",
    url:"/system/request/edit",
    data:data
  })

  return res
}


export  async function updateApplicationStatus(data) {
  let res = await request({
    method:"put",
    url:"/system/application/edit",
    data:data
  })

  return res
}



export  async function getProList(data) {
  let res = await request({
    method:"get",
    url:"/system/equipment/list2",
    data:data
  })

  return res.data
}
export  async function requestList3(data) {
  let res = await request({
    method:"post",
    url:"/system/request/list3",
    params:data
  })

  return res
}
export  async function equipmentInsert(data) {
  let res = await request({
    method:"post",
    url:"/system/equipmentUseLog/add",
    data:data
  })

  return res
}

export  async function equipmentUpdate(data) {
  let res = await request({
    method:"post",
    url:"/system/equipmentUseLog/edit",
    data:data
  })

  return res
}

export  async function getOrders(data) {
  let res = await request({
    method:"get",
    url:"/system/order/"+data,
  })

  return res
}
export  async function applicationList(data) {
  let res = await request({
    method:"get",
    url:"/system/application/list2",
    params:data
  })

  return res
}
export  async function equipmentUseLogList3(data) {
  let res = await request({
    method:"get",
    url:"/system/equipmentUseLog/list3",
    params:data
  })

  return res.data
}
export  async function orderFinish(data) {
  let res = await request({
    method:"post",
    url:"/system/order/finish",
    data:data
  })

  return res.data
}
export  async function orderList(data) {
  let res = await request({
    method:"get",
    url:"/system/order/list",
    params:data
  })

  return res
}
export  async function storeApplicationList(data) {
  let res = await request({
    method:"get",
    url:"/system/storeApplication/list",
    params:data
  })

  return res
}
export  async function updateShopVerify(data) {
  let res = await request({
    method:"put",
    url:"/system/storeApplication/edit",
    data:data
  })

  return res
}

export  async function tyreInstallRequest(data) {

  let res = await request({
    method:"get",
    url:"/tyreInstallRequest/list2",
    params:data
  })

  return res
}
//根据id查询查询轮胎信息
export  async function tyreInstallLogList2(data) {
  let res = await request({
    method:"get",
    url:"/tyreInstallLog/list2",
    params:data
  })

  return res.data
}

//安装轮胎审核
export  async function updateInstallTyre(data) {
  let res = await request({
    method:"put",
    url:"/tyreInstallRequest/edit",
    data:data
  })

  return res.data
}
//获取鼓包申请列表
export  async function claimApplicationList(data) {
  let res = await request({
    method:"get",
    url:"/claimRequest/list2",
    params:data
  })

  return res
}
//根据id查询具体信息
export  async function claimApplicationListById(data) {
  let res = await request({
    method:"get",
    url:"/claimRequest/claimRequestDetail",
    params:data
  })

  return res.data
}
//安装轮胎审核
export  async function claimRequestEdit(data) {
  let res = await request({
    method:"put",
    url:"/claimRequest/edit",
    data:data
  })

  return res.data
}
//根据code获取轮胎信息
export  async function getTyreByCode(data) {
  let res = await request({
    method:"post",
    url:"/claimRequest/getQrcodeInfo",
    params:data
  })

  return res.data
}
//更换轮胎
export  async function updateTyreReplace(data) {
  let res = await request({
    method:"post",
    url:"/claimRequest/getQrcodeInfo",
    params:data
  })

  return res.data
}
//根据车id查询轮胎
export  async function getTyreById(data) {
  let res = await request({
    method:"post",
    url:"/tyreInstallLog/getTyreListByCarId2",
    params:data
  })

  return res.data
}
// 查询示例图片列表
export function listImage(query) {
  return request({
    url: '/system/image/list',
    method: 'get',
    params: query
  })
}

// 查询示例图片详细
export function getImage(id) {
  return request({
    url: '/system/image/' + id,
    method: 'get'
  })
}

// 新增示例图片
export function addImage(data) {
  return request({
    url: '/system/image/add',
    method: 'post',
    data: data
  })
}

// 修改示例图片
export function updateImage(data) {
  return request({
    url: '/system/image/edit',
    method: 'put',
    data: data
  })
}

// 删除示例图片
export function delImage(id) {
  return request({
    url: '/system/image/' + id,
    method: 'delete'
  })
}
export function getAuditForm(data) {
  return request({
    url: '/system/storeApplication/getAuditStatus',
    method: 'post',
    params: {type:data }
  })
}
export function updateAuditForm(data) {
  return request({
    url: '/system/storeApplication/updateAuditStatus',
    method: 'post',
    params:data
  })
}

// 导出文件
export function exportStoreList(params) {
  return request({
    url: '/system/store/exportStoreList',
    method: 'post',
    params:params,
    responseType: 'blob',
  })
}


// 导出文件
export function exportInstallList(params) {
  return request({
    url: '/tyreInstallRequest/exportInstallList',
    method: 'post',
    params:params,
    responseType: 'blob',
  })
}

// 导出审核文件
export function exportClaim(params) {
  return request({
    url: '/claimRequest/exportClaimRequestList',
    method: 'post',
    params:params,
    responseType: 'blob',
  })
}
export function exportClaim2(params) {
  return request({
    url: '/claimRequest/exportClaimRequestList2',
    method: 'post',
    params:params,
    responseType: 'blob',
  })
}
//获取视频列表
export  async function getVideoList(data) {
  let res = await request({
    method:"post",
    url:"/tyreInstallLog/getVideoList",
    data:data
  })

  return res
}
//获取视频删除
export  async function deleteVideo(data) {
  let res = await request({
    method:"post",
    url:"/tyreInstallLog/deleteVideo",
    params:{id:data}
  })

  return res
}
//删除条形码记录
export  async function deleteCardRecord(data) {
  let res = await request({
    method:"post",
    url:"/tyreInstallLog/deleteTyreLog",
    params:{id:data}
  })

  return res
}
//获取视频列表
export  async function getCarInfoByCode(data) {
  let res = await request({
    method:"post",
    url:"/system/car/getCarByCode",
    params:data
  })

  return res
}
